package com.jc.order.constant;

public enum ProvinceEnum {
    BEIJING("11000000", "北京"),
    TIANJIN("12000000", "天津"),
    HEBEI("13000000", "河北"),
    SHANXI("14000000", "山西"),
    NEIMENGGU("15000000", "内蒙古"),
    LIAONING("21000000", "辽宁"),
    JILIN("22000000", "吉林"),
    HEILONGJIANG("23000000", "黑龙江"),
    SHANGHAI("31000000", "上海"),
    JIANGSU("32000000", "江苏"),
    ZHEJIANG("33000000", "浙江"),
    ANHUI("34000000", "安徽"),
    FUJIAN("35000000", "福建"),
    JIANGXI("36000000", "江西"),
    SHANDONG("37000000", "山东"),
    HENAN("41000000", "河南"),
    HUBEI("42000000", "湖北"),
    HUNAN("43000000", "湖南"),
    GUANGDONG("44000000", "广东"),
    GUANGXI("45000000", "广西"),
    HAINAN("46000000", "海南"),
    CHONGQING("50000000", "重庆"),
    SICHUAN("51000000", "四川"),
    GUIZHOU("52000000", "贵州"),
    YUNNAN("53000000", "云南"),
    XIZANG("54000000", "西藏"),
    SHAANXI("61000000", "陕西"),
    GANSU("62000000", "甘肃"),
    QINGHAI("63000000", "青海"),
    NINGXIA("64000000", "宁夏"),
    XINJIANG("65000000", "新疆");

    private final String code;
    private final String name;

    ProvinceEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ProvinceEnum getByCode(String code) {
        for (ProvinceEnum item : ProvinceEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}